<template>
  <div class="home">
    <h1>Pinia - 基本使用</h1> 
    <h3>count: {{ counterStore.count }}</h3>
    <!-- 展示轮播图数据 -->
    <h2>轮播图</h2>
    <ul>
      <template v-for="item in homeStore.banners" :key="item.acm">
        <li>
          {{ item.title }}
        </li>
      </template>
    </ul>
    <button @click="changeState">修改state</button>
  </div>
</template>

<script setup>
 import useCounter from '@/pinia/counter'
 import useHome from '@/pinia/home'
 const counterStore = useCounter()
const homeStore = useHome()
 function changeState(){
  counterStore.increment(10)
 }
 homeStore.fetchHomeMultidata().then(res=>{
  console.log('action 完成');
 })
</script>
